package logic

import (
	"bw-renting/common"
	"bw-renting/user-rpc/internal/svc"
	"bw-renting/user-rpc/user"
	"bw-renting/user-rpc/userclient"
	"context"
	"fmt"

	"github.com/zeromicro/go-zero/core/logx"
)

type AuthLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewAuthLogic(ctx context.Context, svcCtx *svc.ServiceContext) *AuthLogic {
	return &AuthLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// Todo:用户认证
func (l *AuthLogic) Auth(in *user.AuRequest) (*user.AuResponse, error) {
	// todo: add your logic here and delete this line
	name := in.Name
	idcard := in.Idcard
	r := common.Auth(name, idcard)
	fmt.Println(r)
	return &userclient.AuResponse{
		Code: 200,
		Msg:  "认证成功",
	}, nil

}
